home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / src / cmds / gdb.new / gdb-4.0 / gdb / gdb.info-5 < prev    next >
Encoding:
Text File  |  1991-08-24  |  31.8 KB  |  836 lines

  1. Info file gdb.info, produced by Makeinfo, -*- Text -*- from input
  2. file gdb-all.texi.
  3.  
  4.    This file documents the GNU debugger GDB.
  5.  
  6.    Copyright (C) 1988, 1989, 1990, 1991 Free Software Foundation, Inc.
  7.  
  8.    Permission is granted to make and distribute verbatim copies of
  9. this
  10. manual provided the copyright notice and this permission notice are
  11. preserved on all copies.
  12.  
  13.    Permission is granted to copy and distribute modified versions of
  14. this
  15. manual under the conditions for verbatim copying, provided also that
  16. the section entitled "GNU General Public License" is included
  17. exactly as in the original, and provided that the entire resulting
  18. derived work is distributed under the terms of a permission notice
  19. identical to this one.
  20.  
  21.    Permission is granted to copy and distribute translations of this
  22. manual into another language, under the above conditions for
  23. modified versions, except that the section entitled "GNU General
  24. Public License" may be included in a translation approved by the
  25. Free Software Foundation instead of in the original English.
  26.  
  27. 
  28. File: gdb.info,  Node: Output,  Prev: Command Files,  Up: Sequences
  29.  
  30. Commands for Controlled Output
  31. ==============================
  32.  
  33.    During the execution of a command file or a user-defined command,
  34. normal GDB output is suppressed; the only output that appears is
  35. what is explicitly printed by the commands in the definition.  This
  36. section describes three commands useful for generating exactly the
  37. output
  38. you want.
  39.  
  40. `echo TEXT'
  41.      Print TEXT.  Nonprinting characters can be included in TEXT
  42.      using C escape sequences, such as `\n' to print a newline.  No
  43.      newline will be printed unless you specify one. In addition to
  44.      the standard C escape sequences, a backslash followed by a
  45.      space stands for a space.  This is useful for outputting a
  46.      string with spaces at the beginning or the end, since leading
  47.      and trailing spaces are otherwise trimmed from all arguments. 
  48.      Thus, to print ` and foo = ', use the command `echo \ and foo =
  49.      \ '.
  50.  
  51.      A backslash at the end of TEXT can be used, as in C, to continue
  52.      the command onto subsequent lines.  For example,
  53.  
  54.           echo This is some text\n\
  55.           which is continued\n\
  56.           onto several lines.\n
  57.  
  58.      produces the same output as
  59.  
  60.           echo This is some text\n
  61.           echo which is continued\n
  62.           echo onto several lines.\n
  63.  
  64. `output EXPRESSION'
  65.      Print the value of EXPRESSION and nothing but that value: no
  66.      newlines, no `$NN = '.  The value is not entered in the value
  67.      history either.  *Note Expressions:: for more information on
  68.      expressions.
  69.  
  70. `output/FMT EXPRESSION'
  71.      Print the value of EXPRESSION in format FMT.  You can use the
  72.      same formats as for `print'; *note Output formats::., for more
  73.      information.
  74.  
  75. `printf STRING, EXPRESSIONS...'
  76.      Print the values of the EXPRESSIONS under the control of STRING.
  77.      The EXPRESSIONS are separated by commas and may be either
  78.      numbers or pointers.  Their values are printed as specified by
  79.      STRING, exactly as if the program were to execute
  80.  
  81.           printf (STRING, EXPRESSIONS...);
  82.  
  83.      For example, you can print two values in hex like this:
  84.  
  85.           printf "foo, bar-foo = 0x%x, 0x%x\n", foo, bar-foo
  86.  
  87.      The only backslash-escape sequences that you can use in the
  88.      format string are the simple ones that consist of backslash
  89.      followed by a letter.
  90.  
  91. 
  92. File: gdb.info,  Node: Emacs,  Next: GDB Bugs,  Prev: Sequences,  Up: Top
  93.  
  94. Using GDB under GNU Emacs
  95. *************************
  96.  
  97.    A special interface allows you to use GNU Emacs to view (and edit)
  98. the source files for the program you are debugging with GDB.
  99.  
  100.    To use this interface, use the command `M-x gdb' in Emacs.  Give
  101. the executable file you want to debug as an argument.  This command
  102. starts GDB as a subprocess of Emacs, with input and output through a
  103. newly created Emacs buffer.
  104.  
  105.    Using GDB under Emacs is just like using GDB normally except for
  106. two things:
  107.  
  108.    * All "terminal" input and output goes through the Emacs buffer.
  109.  
  110.    This applies both to GDB commands and their output, and to the
  111. input and output done by the program you are debugging.
  112.  
  113.    This is useful because it means that you can copy the text of
  114. previous commands and input them again; you can even use parts of
  115. the
  116. output in this way.
  117.  
  118.    All the facilities of Emacs' Shell mode are available for
  119. interacting with your program.  In particular, you can send signals
  120. the usual way--for example, `C-c C-c' for an interrupt, `C-c C-z'
  121. for a stop.
  122.  
  123.    * GDB displays source code through Emacs.
  124.  
  125.    Each time GDB displays a stack frame, Emacs automatically finds
  126. the source file for that frame and puts an arrow (`=>') at the left
  127. margin of the current line.  Emacs uses a separate buffer for source
  128. display, and splits the window to show both your GDB session and the
  129. source.
  130.  
  131.    Explicit GDB `list' or search commands still produce output as
  132. usual, but you probably will have no reason to use them.
  133.  
  134.      *Warning:* If the directory where your program resides is not
  135.      your current directory, it can be easy to confuse Emacs about
  136.      the location of the source files, in which case the auxiliary
  137.      display buffer will not appear to show your source.  GDB can
  138.      find programs by searching your environment's `PATH' variable,
  139.      so the GDB input and output session will proceed normally; but
  140.      Emacs doesn't get enough information back from GDB to locate
  141.      the source files in this situation.  To avoid this problem,
  142.      either start GDB mode from the directory where your program
  143.      resides, or specify a full path name when prompted for the `M-x
  144.      gdb' argument.
  145.  
  146.      A similar confusion can result if you use the GDB `file' command
  147.      to switch to debugging a program in some other location, from
  148.      an existing GDB buffer in Emacs.
  149.  
  150.    By default, `M-x gdb' calls the program called `gdb'.  If you need
  151. to call GDB by a different name (for example, if you keep several
  152. configurations around, with different names) you can set the Emacs
  153. variable `gdb-command-name'; for example,
  154.  
  155.      (setq gdb-command-name "mygdb")
  156.  
  157. (preceded by `ESC ESC', or typed in the `*scratch*' buffer, or in
  158. your `.emacs' file) will make Emacs call the program named "`mygdb'"
  159. instead.
  160.  
  161.    In the GDB I/O buffer, you can use these special Emacs commands in
  162. addition to the standard Shell mode commands:
  163.  
  164. `C-h m'
  165.      Describe the features of Emacs' GDB Mode.
  166.  
  167. `M-s'
  168.      Execute to another source line, like the GDB `step' command;
  169.      also update the display window to show the current file and
  170.      location.
  171.  
  172. `M-n'
  173.      Execute to next source line in this function, skipping all
  174.      function calls, like the GDB `next' command.  Then update the
  175.      display window to show the current file and location.
  176.  
  177. `M-i'
  178.      Execute one instruction, like the GDB `stepi' command; update
  179.      display window accordingly.
  180.  
  181. `M-x gdb-nexti'
  182.      Execute to next instruction, using the GDB `nexti' command;
  183.      update display window accordingly.
  184.  
  185. `C-c C-f'
  186.      Execute until exit from the selected stack frame, like the GDB
  187.      `finish' command.
  188.  
  189. `M-c'
  190.      Continue execution of the program, like the GDB `continue'
  191.      command.  *Warning:* In Emacs v19, this command is `C-c C-p'.
  192.  
  193. `M-u'
  194.      Go up the number of frames indicated by the numeric argument
  195.      (*note Numeric Arguments: (emacs)Arguments.), like the GDB `up'
  196.      command.  *Warning:* In Emacs v19, this command is `C-c C-u'.
  197.  
  198. `M-d'
  199.      Go down the number of frames indicated by the numeric argument,
  200.      like the GDB `down' command.  *Warning:* In Emacs v19, this
  201.      command is `C-c C-d'.
  202.  
  203. `C-x &'
  204.      Read the number where the cursor is positioned, and insert it at
  205.      the end of the GDB I/O buffer.  For example, if you wish to
  206.      disassemble code around an address that was displayed earlier,
  207.      type `disassemble'; then move the cursor to the address
  208.      display, and pick up the argument for `disassemble' by typing
  209.      `C-x &'.
  210.  
  211.      You can customize this further on the fly by defining elements
  212.      of the list `gdb-print-command'; once it is defined, you can
  213.      format or otherwise process numbers picked up by `C-x &' before
  214.      they are inserted.  A numeric argument to `C-x &' will both
  215.      flag that you wish special formatting, and act as an index to
  216.      pick an element of the list.  If the list element is a string,
  217.      the number to be inserted is formatted using the Emacs function
  218.      `format'; otherwise the number is passed as an argument to the
  219.      corresponding list element.
  220.  
  221.    In any source file, the Emacs command `C-x SPC' (`gdb-break')
  222. tells GDB to set a breakpoint on the source line point is on.
  223.  
  224.    If you accidentally delete the source-display buffer, an easy way
  225. to get it back is to type the command `f' in the GDB buffer, to
  226. request a frame display; when you run under Emacs, this will
  227. recreate the source buffer if necessary to show you the context of
  228. the current frame.
  229.  
  230.    The source files displayed in Emacs are in ordinary Emacs buffers
  231. which are visiting the source files in the usual way.  You can edit
  232. the files with these buffers if you wish; but keep in mind that GDB
  233. communicates with Emacs in terms of line numbers.  If you add or
  234. delete lines from the text, the line numbers that GDB knows will
  235. cease to correspond properly to the code.
  236.  
  237. 
  238. File: gdb.info,  Node: GDB Bugs,  Next: Renamed Commands,  Prev: Emacs,  Up: Top
  239.  
  240. Reporting Bugs in GDB
  241. *********************
  242.  
  243.    Your bug reports play an essential role in making GDB reliable.
  244.  
  245.    Reporting a bug may help you by bringing a solution to your
  246. problem, or it may not.  But in any case the principal function of a
  247. bug report is to help the entire community by making the next
  248. version of GDB work better.  Bug reports are your contribution to
  249. the maintenance of GDB.
  250.  
  251.    In order for a bug report to serve its purpose, you must include
  252. the information that enables us to fix the bug.
  253.  
  254. * Menu:
  255.  
  256. * Bug Criteria::                Have You Found a Bug?
  257. * Bug Reporting::               How to Report Bugs
  258.  
  259. 
  260. File: gdb.info,  Node: Bug Criteria,  Next: Bug Reporting,  Prev: GDB Bugs,  Up: GDB Bugs
  261.  
  262. Have You Found a Bug?
  263. =====================
  264.  
  265.    If you are not sure whether you have found a bug, here are some
  266. guidelines:
  267.  
  268.    * If the debugger gets a fatal signal, for any input whatever,
  269.      that is a GDB bug.  Reliable debuggers never crash.
  270.  
  271.    * If GDB produces an error message for valid input, that is a bug.
  272.  
  273.    * If GDB does not produce an error message for invalid input, that
  274.      is a bug.  However, you should note that your idea of "invalid
  275.      input" might be our idea of "an extension" or "support for
  276.      traditional practice".
  277.  
  278.    * If you are an experienced user of debugging tools, your
  279.      suggestions for improvement of GDB are welcome in any case.
  280.  
  281. 
  282. File: gdb.info,  Node: Bug Reporting,  Prev: Bug Criteria,  Up: GDB Bugs
  283.  
  284. How to Report Bugs
  285. ==================
  286.  
  287.    A number of companies and individuals offer support for GNU
  288. products.  If you obtained GDB from a support organization, we
  289. recommend you contact that organization first.
  290.  
  291.    Contact information for many support companies and individuals is
  292. available in the file `etc/SERVICE' in the GNU Emacs distribution.
  293.  
  294.    In any event, we also recommend that you send bug reports for GDB
  295. to one of these addresses:
  296.  
  297.      bug-gdb@prep.ai.mit.edu
  298.      {ucbvax|mit-eddie|uunet}!prep.ai.mit.edu!bug-gdb
  299.  
  300.    *Do not send bug reports to `info-gdb', or to `help-gdb', or to
  301. any newsgroups.* Most users of GDB do not want to receive bug
  302. reports.  Those that do, have arranged to receive `bug-gdb'.
  303.  
  304.    The mailing list `bug-gdb' has a newsgroup `gnu.gdb.bug' which
  305. serves as a repeater.  The mailing list and the newsgroup carry
  306. exactly the same messages.  Often people think of posting bug
  307. reports to the newsgroup instead of mailing them.  This appears to
  308. work, but it has one problem which can be crucial: a newsgroup
  309. posting often lacks a mail path back to the sender.  Thus, if we
  310. need to ask for more information, we may be unable to reach you. 
  311. For this reason, it is better to send bug reports to the mailing list.
  312.  
  313.    As a last resort, send bug reports on paper to:
  314.  
  315.      GNU Debugger Bugs
  316.      Free Software Foundation
  317.      545 Tech Square
  318.      Cambridge, MA 02139
  319.  
  320.    The fundamental principle of reporting bugs usefully is this:
  321. *report all the facts*.  If you are not sure whether to state a fact
  322. or leave it out, state it!
  323.  
  324.    Often people omit facts because they think they know what causes
  325. the problem and assume that some details don't matter.  Thus, you
  326. might assume that the name of the variable you use in an example
  327. does not matter.  Well, probably it doesn't, but one cannot be sure.
  328. Perhaps the bug is a stray memory reference which happens to fetch
  329. from the location where that name is stored in memory; perhaps, if
  330. the name were different, the contents of that location would fool
  331. the debugger into doing the right thing despite the bug.  Play it
  332. safe and give a specific, complete example.  That is the easiest
  333. thing for you to do, and the most helpful.
  334.  
  335.    Keep in mind that the purpose of a bug report is to enable us to
  336. fix the bug if it is new to us.  It isn't as important what happens
  337. if the bug is already known.  Therefore, always write your bug
  338. reports on the assumption that the bug has not been reported
  339. previously.
  340.  
  341.    Sometimes people give a few sketchy facts and ask, "Does this ring
  342. a bell?"  Those bug reports are useless, and we urge everyone to
  343. *refuse to respond to them* except to chide the sender to report
  344. bugs properly.
  345.  
  346.    To enable us to fix the bug, you should include all these things:
  347.  
  348.    * The version of GDB.  GDB announces it if you start with no
  349.      arguments; you can also print it at any time using `show
  350.      version'.
  351.  
  352.      Without this, we won't know whether there is any point in
  353.      looking for the bug in the current version of GDB.
  354.  
  355.    * A complete input script, and all necessary source files, that
  356.      will reproduce the bug.
  357.  
  358.    * What compiler (and its version) was used to compile GDB--e.g. 
  359.      "gcc-1.37.1".
  360.  
  361.    * The command arguments you gave the compiler to compile your
  362.      example and observe the bug.  For example, did you use `-O'? 
  363.      To
  364.      guarantee you won't omit something important, list them all.
  365.  
  366.      If we were to try to guess the arguments, we would probably
  367.      guess wrong and then we might not encounter the bug.
  368.  
  369.    * The type of machine you are using, and the operating system name
  370.      and version number.
  371.  
  372.    * A description of what behavior you observe that you believe is
  373.      incorrect.  For example, "It gets a fatal signal."
  374.  
  375.      Of course, if the bug is that GDB gets a fatal signal, then we
  376.      will certainly notice it.  But if the bug is incorrect output,
  377.      we might not notice unless it is glaringly wrong.  We are
  378.      human, after all.  You might as well not give us a chance to
  379.      make a mistake.
  380.  
  381.      Even if the problem you experience is a fatal signal, you should
  382.      still say so explicitly.  Suppose something strange is going
  383.      on, such as, your copy of GDB is out of synch, or you have
  384.      encountered a bug in the C library on your system.  (This has
  385.      happened!)  Your copy might crash and ours would not.  If you
  386.      told us to expect a crash, then when ours fails to crash, we
  387.      would know that the bug was not happening for us.  If you had
  388.      not told us to expect a crash, then we would not be able to
  389.      draw any conclusion from our observations.
  390.  
  391.    * If you wish to suggest changes to the GDB source, send us
  392.      context diffs.  If you even discuss something in the GDB
  393.      source, refer to it by context, not by line number.
  394.  
  395.      The line numbers in our development sources won't match those in
  396.      your sources.  Your line numbers would convey no useful
  397.      information to us.
  398.  
  399.    Here are some things that are not necessary:
  400.  
  401.    * A description of the envelope of the bug.
  402.  
  403.      Often people who encounter a bug spend a lot of time
  404.      investigating which changes to the input file will make the bug
  405.      go away and which changes will not affect it.
  406.  
  407.      This is often time consuming and not very useful, because the
  408.      way we will find the bug is by running a single example under
  409.      the debugger with breakpoints, not by pure deduction from a
  410.      series of examples.  We recommend that you save your time for
  411.      something else.
  412.  
  413.      Of course, if you can find a simpler example to report *instead*
  414.      of the original one, that is a convenience for us.  Errors in
  415.      the output will be easier to spot, running under the debugger
  416.      will take less time, etc.
  417.  
  418.      However, simplification is not vital; if you don't want to do
  419.      this, report the bug anyway and send us the entire test case
  420.      you used.
  421.  
  422.    * A patch for the bug.
  423.  
  424.      A patch for the bug does help us if it is a good one.  But don't
  425.      omit the necessary information, such as the test case, on the
  426.      assumption that a patch is all we need.  We might see problems
  427.      with your patch and decide to fix the problem another way, or
  428.      we might not understand it at all.
  429.  
  430.      Sometimes with a program as complicated as GDB it is very hard
  431.      to construct an example that will make the program follow a
  432.      certain path through the code.  If you don't send us the
  433.      example, we won't be able to construct one, so we won't be able
  434.      to verify that the bug is fixed.
  435.  
  436.      And if we can't understand what bug you are trying to fix, or
  437.      why your patch should be an improvement, we won't install it. 
  438.      A test case will help us to understand.
  439.  
  440.    * A guess about what the bug is or what it depends on.
  441.  
  442.      Such guesses are usually wrong.  Even we can't guess right about
  443.      such things without first using the debugger to find the facts.
  444.  
  445. 
  446. File: gdb.info,  Node: Renamed Commands,  Next: Installing GDB,  Prev: GDB Bugs,  Up: Top
  447.  
  448. Renamed Commands
  449. ****************
  450.  
  451.    The following commands were renamed in GDB 4.0, in order to make
  452. the command set as a whole more consistent and easier to use and
  453. remember:
  454.  
  455.      OLD COMMAND               NEW COMMAND
  456.      ---------------           -------------------------------
  457.      add-syms                  add-symbol-file
  458.      delete environment        unset environment
  459.      info convenience          show convenience
  460.      info copying              show copying
  461.      info directories          show directories     
  462.      info editing              show commands
  463.      info history              show values
  464.      info targets              help target
  465.      info values               show values
  466.      info version              show version
  467.      info warranty             show warranty
  468.      set/show addressprint     set/show print address
  469.      set/show array-max        set/show print elements
  470.      set/show arrayprint       set/show print array
  471.      set/show asm-demangle     set/show print asm-demangle
  472.      set/show caution          set/show confirm
  473.      set/show demangle         set/show print demangle
  474.      set/show history write    set/show history save
  475.      set/show prettyprint      set/show print pretty
  476.      set/show screen-height    set/show height
  477.      set/show screen-width     set/show width
  478.      set/show sevenbit-strings set/show print sevenbit-strings
  479.      set/show unionprint       set/show print union
  480.      set/show vtblprint        set/show print vtbl
  481.      
  482.      unset                     [No longer an alias for delete]
  483.  
  484. 
  485. File: gdb.info,  Node: Installing GDB,  Next: Copying,  Prev: Renamed Commands,  Up: Top
  486.  
  487. Installing GDB
  488. **************
  489.  
  490.    GDB comes with a `configure' script that automates the process of
  491. preparing GDB for installation; you can then use `make' to build the
  492. `gdb' program.
  493.  
  494.    The gdb distribution includes all the source code you need for gdb
  495. in a single directory `gdb-4.0'.  That directory in turn contains:
  496.  
  497. `gdb-4.0/configure'
  498.      Overall script for configuring GDB and all its supporting
  499.      libraries.
  500.  
  501. `gdb-4.0/gdb'
  502.      the source specific to GDB itself
  503.  
  504. `gdb-4.0/bfd'
  505.      source for the Binary File Descriptor Library
  506.  
  507. `gdb-4.0/include'
  508.      GNU include files
  509.  
  510. `gdb-4.0/libiberty'
  511.      source for the `-liberty' free software library
  512.  
  513. `gdb-4.0/readline'
  514.      source for the GNU command-line interface
  515.  
  516. Each of these directories has its own `configure' script, which are
  517. used by the overall `configure' script in `gdb-4.0'.
  518.  
  519.    It is most convenient to run `configure' from the `gdb-4.0'
  520. directory.  The simplest way to configure and build GDB is the
  521. following:
  522.  
  523.      cd gdb-4.0
  524.      ./configure HOST
  525.      make
  526.  
  527. where HOST is something like `sun4' or `decstation', that identifies
  528. the platform where GDB will run.  This builds the three libraries
  529. `bfd', `readline', and `libiberty', then `gdb' itself.  The
  530. configured source files, and the binaries, are left in the
  531. corresponding source directories.
  532.  
  533.    You can install `gdb' anywhere; it has no hardwired paths. 
  534. However, you should make sure that the shell on your path (named by
  535. the `SHELL' environment variable) is publicly readable; some systems
  536. refuse to let GDB debug child processes whose programs are not
  537. readable, and GDB uses the shell to start your program.
  538.  
  539. * Menu:
  540.  
  541. * Subdirectories::              Configuration subdirectories
  542. * Config Names::                Specifying names for hosts and targets
  543. * configure Options::           Summary of options for configure
  544. * Formatting Manual::          How to format and print GDB documentation
  545.  
  546. 
  547. File: gdb.info,  Node: Subdirectories,  Next: Config Names,  Prev: Installing GDB,  Up: Installing GDB
  548.  
  549. Configuration Subdirectories
  550. ============================
  551.  
  552.    If you want to run GDB versions for several host or target
  553. machines, you'll need a different gdb compiled for each combination
  554. of host and target.  `configure' is designed to make this easy by
  555. allowing you to generate each configuration in a separate
  556. subdirectory.  If your `make' program handles the `VPATH' feature
  557. (GNU `make' does), running `make' in each of these directories then
  558. builds the gdb program specified there.
  559.  
  560.    `configure' creates these subdirectories for you when you
  561. simultaneously specify several configurations; but it's a good habit
  562. even for a single configuration.  You can specify the use of
  563. subdirectories using the `+subdirs' option (abbreviated `+sub'). 
  564. For example, you can build GDB on a Sun 4 as follows:
  565.  
  566.      cd gdb-4.0
  567.      ./configure +sub sun4
  568.      cd Host-sparc-sun-sunos4/Target-sparc-sun-sunos4
  569.      make
  570.  
  571.    When `configure' uses subdirectories to build programs or
  572. libraries, it creates nested directories `Host-HOST/Target-TARGET'. 
  573. (As you see in the example, the names used for HOST and TARGET may
  574. be expanded from your `configure' argument; *note Config Names::.).
  575. `configure' uses these two directory levels because GDB can be
  576. configured for cross-compiling: GDB can run on one machine (the
  577. host) while debugging programs that run on another machine (the
  578. target).  You specify cross-debugging targets by giving the
  579. `+target=TARGET' option to `configure'.  Specifying only hosts still
  580. gives you two levels of subdirectory for each host, with the same
  581. configuration suffix on both; that is, if you give any number of
  582. hosts but no targets, GDB will be configured for native debugging on
  583. each host.  On the other hand, whenever you specify both hosts and
  584. targets on the same command line, `configure' creates all
  585. combinations of the hosts and targets you list.
  586.  
  587.    When you run `make' to build a program or library, you must run it
  588. in a configured directory.  If you made a single configuration,
  589. without subdirectories, run `make' in the source directory.  If you
  590. have `Host-HOST/Target-TARGET' subdirectories, run `make' in those
  591. subdirectories.
  592.  
  593.    Each `configure' and `Makefile' under each source directory runs
  594. recursively, so that typing `make' in `gdb-4.0' (or in a
  595. `gdb-4.0/Host-HOST/Target-TARGET' subdirectory) builds all the
  596. required libraries, then GDB.
  597.  
  598.    If you run `configure' from a directory (such as `gdb-4.0') that
  599. contains source directories for multiple libraries or programs,
  600. `configure' creates the `Host-HOST/Target-TARGET' subdirectories in
  601. each library or program's source directory.  For example, typing:
  602.  
  603.      cd gdb-4.0
  604.      configure sun4 +target=vxworks960
  605.  
  606. creates the following directories:
  607.  
  608.      gdb-4.0/Host-sparc-sun-sunos4/Target-i960-wrs-vxworks
  609.      gdb-4.0/bfd/Host-sparc-sun-sunos4/Target-i960-wrs-vxworks
  610.      gdb-4.0/gdb/Host-sparc-sun-sunos4/Target-i960-wrs-vxworks
  611.      gdb-4.0/libiberty/Host-sparc-sun-sunos4/Target-i960-wrs-vxworks
  612.      gdb-4.0/readline/Host-sparc-sun-sunos4/Target-i960-wrs-vxworks
  613.  
  614. The `Makefile' in
  615.  
  616.      gdb-4.0/Host-sparc-sun-sunos4/Target-i960-wrs-vxworks
  617.  
  618. will `cd' to the appropriate lower-level directories, for example:
  619.  
  620.      gdb-4.0/bfd/Host-sparc-sun-sunos4/Target-i960-wrs-vxworks
  621.  
  622. building each in turn.
  623.  
  624.    When you have multiple hosts or targets configured, you can run
  625. `make' on them in parallel (for example, if they are NFS-mounted on
  626. each of the hosts); they will not interfere with each other.
  627.  
  628. 
  629. File: gdb.info,  Node: Config Names,  Next: configure Options,  Prev: Subdirectories,  Up: Installing GDB
  630.  
  631. Specifying Names for Hosts and Targets
  632. ======================================
  633.  
  634.    The specifications used for hosts and targets in the `configure'
  635. script are based on a three-part naming scheme, but some short
  636. predefined aliases are also supported.  The full naming scheme
  637. encodes three pieces of information in the following pattern:
  638.  
  639.      ARCHITECTURE-VENDOR-OS
  640.  
  641.    For example, you can use the alias `sun4' as a HOST argument or in
  642. a `+target='TARGET option, but the full name of that configuration
  643. specifies that the architecture is `sparc', the vendor is `sun', and
  644. the operating system is `sunos4'.
  645.  
  646.    The following table shows all the architectures, hosts, and OS
  647. prefixes that `configure' recognizes in GDB 4.0.  Entries in the "OS
  648. prefix"
  649. column ending in a `*' may be followed by a release number.
  650.  
  651.  
  652.      ARCHITECTURE  VENDOR        OS prefix
  653.      ------------+-------------+-------------
  654.                  |             |
  655.       a29k       | altos       | aix*
  656.       alliant    | aout        | aout
  657.       arm        | apollo      | bout
  658.       c1         | att         | bsd*
  659.       c2         | bout        | coff
  660.       i386       | coff        | ctix*
  661.       i860       | convergent  | dynix*
  662.       i960       | convex      | esix*
  663.       m68000     | dec         | hpux*
  664.       m68k       | encore      | isc*
  665.       m88k       | gould       | mach*
  666.       mips       | hp          | newsos*
  667.       ns32k      | ibm         | nindy*
  668.       pyramid    | intel       | none
  669.       rs6000     | isi         | osf*
  670.       rtpc       | little      | sco*    
  671.       sparc      | mips        | sunos*  
  672.       tahoe      | motorola    | sysv*   
  673.       tron       | ncr         | ultrix* 
  674.       vax        | next        | unos*   
  675.                  | none        | v88r*   
  676.                  | sco         | vms*    
  677.                  | sequent     | vxworks*
  678.                  | sgi         | 
  679.                  | sony        |
  680.                  | sun         |
  681.                  | unicom      |
  682.                  | utek        |
  683.                  | wrs         |
  684.  
  685.      *Warning:* Many combinations of architecture, vendor, and OS are
  686.      untested.
  687.  
  688.    The `configure' script accompanying GDB 4.0 does not provide any
  689. query facility to list all supported host and target names or
  690. aliases.  `configure' calls the Bourne shell script `config.sub' to
  691. map abbreviations to full names; you can read the script, if you
  692. wish, or you can use it to test your guesses on abbreviations--for
  693. example:
  694.  
  695.      % sh config.sub sun4
  696.      sparc-sun-sunos4
  697.      % sh config.sub sun3
  698.      m68k-sun-sunos4
  699.      % sh config.sub decstation
  700.      mips-dec-ultrix
  701.      % sh config.sub hp300bsd
  702.      m68k-hp-bsd
  703.      % sh config.sub i386v
  704.      i386-none-sysv
  705.      % sh config.sub i486v
  706.      *** No vendor: configuration `i486v' not recognized
  707.  
  708. 
  709. File: gdb.info,  Node: configure Options,  Next: Formatting Manual,  Prev: Config Names,  Up: Installing GDB
  710.  
  711. `configure' Options
  712. ===================
  713.  
  714.    Here is a summary of all the `configure' options and arguments
  715. that you might use for building GDB:
  716.  
  717.      configure [+destdir=DIR] [+subdirs] [+norecur] [+rm]
  718.                [+target=TARGET...] HOST...
  719.  
  720. You may introduce options with the character `-' rather than `+' if
  721. you prefer; but you may abbreviate option names if you use `+'.
  722.  
  723. `+destdir=DIR'
  724.      DIR is an installation directory *path prefix*.  After you
  725.      configure with this option, `make install' will install GDB as
  726.      `DIR/bin/gdb', and the libraries in `DIR/lib'.  If you specify
  727.      `+destdir=/usr/local', for example, `make install' creates
  728.      `/usr/local/bin/gdb'.
  729.  
  730. `+subdirs'
  731.      Write configuration specific files in subdirectories of the form
  732.  
  733.           Host-HOST/Target-TARGET
  734.  
  735.      (and configure the `Makefile' to write binaries there too). 
  736.      Without this option, if you specify only one configuration for
  737.      GDB, `configure' will use the same directory for source,
  738.      configured files, and binaries.  This option is used
  739.      automatically if you specify more than one HOST or more than
  740.      one
  741.      `+target=TARGET' option on the `configure' command line.
  742.  
  743. `+norecur'
  744.      Configure only the directory where `configure' is executed; do
  745.      not propagate configuration to subdirectories.
  746.  
  747. `+rm'
  748.      Remove the configuration that the other arguments specify.
  749.  
  750. `+target=TARGET ...'
  751.      Configure GDB for cross-debugging programs running on each
  752.      specified TARGET.  You may specify as many `+target' options as
  753.      you wish.  Without this option, GDB is configured to debug
  754.      programs that run on the same machine (HOST) as GDB itself.
  755.  
  756.      There is no convenient way to generate a list of all available
  757.      targets.
  758.  
  759. `HOST ...'
  760.      Configure GDB to run on each specified HOST.  You may specify as
  761.      many host names as you wish.
  762.  
  763.      There is no convenient way to generate a list of all available
  764.      hosts.
  765.  
  766. `configure' accepts other options, for compatibility with configuring
  767. other GNU tools recursively; but these are the only options that
  768. affect GDB or its supporting libraries.
  769.  
  770. 
  771. File: gdb.info,  Node: Formatting Manual,  Prev: configure Options,  Up: Installing GDB
  772.  
  773. Formatting this Manual
  774. ======================
  775.  
  776.    The GDB 4.0 release includes the Info version of this manual
  777. already formatted: the main Info file is `gdb-4.0/gdb/gdb.info', and
  778. it
  779. refers to subordinate files matching `gdb.info*' in the same
  780. directory.
  781.  
  782.    If you want to make these Info files yourself from the GDB
  783. manual's source, you need the GNU `makeinfo' program.  Once you have
  784. it,
  785. you can type
  786.  
  787.      cd gdb-4.0/gdb
  788.      make gdb.info
  789.  
  790. to make the Info file.
  791.  
  792.    If you want to format and print copies of this manual, you need
  793. several things:
  794.  
  795.    * TeX, the public domain typesetting program written by Donald
  796.      Knuth, must be installed on your system and available through
  797.      your execution path.
  798.  
  799.    * `gdb-4.0/texinfo': TeX macros defining the GNU Documentation
  800.      Format.
  801.  
  802.    * *A DVI output program.*  TeX doesn't actually make marks on
  803.      paper; it produces output files called DVI files.  If your
  804.      system has TeX installed, chances are it has a program for
  805.      printing out these files; one popular example is `dvips', which
  806.      can print DVI files on PostScript printers.
  807.  
  808. Once you have these things, you can type
  809.  
  810.      cd gdb-4.0/gdb
  811.      make gdb.dvi
  812.  
  813. to format the text of this manual, and print it with the usual output
  814. method for TeX DVI files at your site.
  815.  
  816.    You might also want hard copy of the GDB reference card.  The GDB
  817. 4.0 release includes an already-formatted reference card, ready for
  818. printing on a PostScript printer, as `gdb-4.0/gdb/refcard.ps'.  It
  819. uses the most common PostScript fonts: the Times family, Courier,
  820. and Symbol.  If you have a PostScript printer you can print the
  821. reference card by just sending `refcard.ps' to the printer.
  822.  
  823.    If you have some other kind of printer, or want to print using
  824. Computer Modern fonts instead, you can still print the reference
  825. card
  826. if you have TeX.  Format the reference card by typing
  827.  
  828.      cd gdb-4.0/gdb
  829.      make refcard.dvi
  830.  
  831. The GDB reference card is designed to print in landscape mode on US
  832. "letter" size paper; that is, on a sheet 11 inches wide by 8.5
  833. inches high.  You will need to specify this form of printing as an
  834. option to your DVI output program.
  835.  
  836.